<%= form_for @task, :html => { :class => "form-horizontal task" , multipart: true } do |f| %>

    <% if @task.errors.any? %>
    <div id="error_expl" class="panel panel-danger">
      <div class="panel-heading">
        <h3 class="panel-title"><%= pluralize(@task.errors.count, "error") %> prohibited this task from being saved:</h3>
      </div>
      <div class="panel-body">
        <ul>
        <% @task.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
        </ul>
      </div>
    </div>
  <% end %>

  <div class="control-group">
    <%= f.label :name, :class => 'control-label' %>
    <div class="controls">
      <%= f.text_field :name, :class => 'form-control' %>
    </div>
    <%= error_span(@task[:name]) %>
  </div>
  <div class="control-group">
    <%= f.label :num_of_fingers, :class => 'control-label' %>
    <div class="controls">
      <%= f.text_field :num_of_fingers, :class => 'form-control' %>
    </div>
    <%= error_span(@task[:num_of_fingers]) %>
  </div>
  <div class="control-group">
    <%= f.label :num_of_samples, :class => 'control-label' %>
    <div class="controls">
      <%= f.text_field :num_of_samples, :class => 'form-control' %>
    </div>
    <%= error_span(@task[:num_of_samples]) %>
  </div>
  <div class="control-group">
    <%= f.label :sample_file, 'Sample file', :class => 'control-label' %>
    <div class="controls">
      <%= file_field_tag 'sample_file' %>
    </div>
  </div>

  <br>
  <%= f.submit nil, :class => 'btn btn-primary' %>
  <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
            tasks_path, :class => 'btn btn-default' %>

<% end %>
